package ceha;

import ceha.util.Utils;
import java.io.File;
import java.io.IOException;
import javax.swing.JFileChooser;

public class FicheJInternalFrame extends javax.swing.JInternalFrame {

    static int openFrameCount = 0;
    static final int xOffset = 30, yOffset = 30;

    /** Creates new form FicheJInternalFrame */
    public FicheJInternalFrame() {
        initComponents();

    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        entityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("cehaPU").createEntityManager();
        query = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT f FROM Fiche f");
        list = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList(query.getResultList());
        jPanel2 = new javax.swing.JPanel();
        lienimageLabel = new javax.swing.JLabel();
        lienfichierLabel = new javax.swing.JLabel();
        resumeLabel = new javax.swing.JLabel();
        datetexteLabel = new javax.swing.JLabel();
        dateLabel = new javax.swing.JLabel();
        auteurLabel = new javax.swing.JLabel();
        titreLabel = new javax.swing.JLabel();
        sourceLabel = new javax.swing.JLabel();
        imagefilenameLabel = new javax.swing.JLabel();
        imagefilenameField = new javax.swing.JTextField();
        jComboBox1 = new javax.swing.JComboBox();
        typedocumentLabel = new javax.swing.JLabel();
        typedocCombo = new javax.swing.JComboBox();
        titreField = new javax.swing.JTextField();
        auteurField = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();
        lienimageField = new javax.swing.JTextField();
        lienfichierField = new javax.swing.JTextField();
        parcourirvignette = new javax.swing.JButton();
        jDateChooser1 = new com.toedter.calendar.JDateChooser();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jComboBox2 = new javax.swing.JComboBox();
        jPanel4 = new javax.swing.JPanel();
        vignette = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        idcorrecteurField = new javax.swing.JTextField();
        idcorrecteurLabel = new javax.swing.JLabel();
        datecorrectionField = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        datecorrectionLabel = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jTextField1 = new javax.swing.JTextField();
        datedonationField = new javax.swing.JTextField();
        jComboBox3 = new javax.swing.JComboBox();
        localisationField = new javax.swing.JTextField();
        dimensionField = new javax.swing.JTextField();
        dimensionLabel = new javax.swing.JLabel();
        localisationLabel = new javax.swing.JLabel();
        datedonationLabel = new javax.swing.JLabel();
        fondLabel = new javax.swing.JLabel();
        droitsreproLabel = new javax.swing.JLabel();

        jPanel2.setBackground(new java.awt.Color(204, 204, 204));
        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "description du document", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Verdana", 3, 12), new java.awt.Color(51, 51, 0))); // NOI18N

        lienimageLabel.setFont(new java.awt.Font("Tahoma", 1, 12));
        lienimageLabel.setText("Lien Image :");

        lienfichierLabel.setFont(new java.awt.Font("Tahoma", 1, 12));
        lienfichierLabel.setText("Lien fichier PDF");

        resumeLabel.setFont(new java.awt.Font("Times New Roman", 1, 14));
        resumeLabel.setText("Resumé");

        datetexteLabel.setFont(new java.awt.Font("Times New Roman", 1, 12));
        datetexteLabel.setText("Date (autres formats)");

        dateLabel.setFont(new java.awt.Font("Times New Roman", 1, 14));
        dateLabel.setText("Date de prise de vue");

        auteurLabel.setFont(new java.awt.Font("Times New Roman", 1, 14));
        auteurLabel.setText("Auteur");

        titreLabel.setFont(new java.awt.Font("Times New Roman", 1, 14));
        titreLabel.setForeground(new java.awt.Color(255, 0, 0));
        titreLabel.setText("Titre *");

        sourceLabel.setFont(new java.awt.Font("Times New Roman", 1, 14));
        sourceLabel.setText("Source:");

        imagefilenameLabel.setFont(new java.awt.Font("Times New Roman", 1, 14));
        imagefilenameLabel.setText("Vignette:");

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Original", "Copie" }));

        typedocumentLabel.setFont(new java.awt.Font("Times New Roman", 1, 14));
        typedocumentLabel.setText("Type de document:");

        typedocCombo.setFont(new java.awt.Font("Verdana", 1, 12));
        typedocCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Affiche", "Album thématique", "Carte postale", "Imprimé", "Journal", "Livre", "Magazine / Revue", "Manuscrit papier", "Manuscrit Vélin", "Matériel archéologique", "Numismatique", "Objet", "Photographie", "Plan", "Tableau / Gravure", "Tapuscrit", "Témoignage audio", "Témoignage vidéo", "Autres" }));
        typedocCombo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                typedocComboActionPerformed(evt);
            }
        });

        titreField.setBackground(new java.awt.Color(255, 255, 204));

        auteurField.setBackground(new java.awt.Color(255, 255, 204));

        jTextArea1.setColumns(20);
        jTextArea1.setFont(new java.awt.Font("Times New Roman", 0, 14));
        jTextArea1.setRows(5);
        jScrollPane1.setViewportView(jTextArea1);

        parcourirvignette.setFont(new java.awt.Font("Times New Roman", 3, 12));
        parcourirvignette.setText("parcourir");
        parcourirvignette.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                parcourirvignetteActionPerformed(evt);
            }
        });

        jDateChooser1.setDateFormatString("YYYY-MM-DD");

        jButton2.setFont(new java.awt.Font("Times New Roman", 3, 12));
        jButton2.setText("parcourir");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2lienfichierActionPerformed(evt);
            }
        });

        jButton3.setFont(new java.awt.Font("Times New Roman", 3, 12));
        jButton3.setText("parcourir");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3lienimageActionPerformed(evt);
            }
        });

        jComboBox2.setFont(new java.awt.Font("Verdana", 1, 12));
        jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "XX     ème", "XIX    ème", "XVIII  ème", "XVII   ème" }));

        jPanel4.setBackground(new java.awt.Color(153, 153, 153));
        jPanel4.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true));

        vignette.setBackground(new java.awt.Color(255, 255, 255));
        vignette.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Vignette", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BELOW_TOP, new java.awt.Font("Verdana", 3, 12), new java.awt.Color(255, 255, 255))); // NOI18N

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(vignette, javax.swing.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(vignette, javax.swing.GroupLayout.PREFERRED_SIZE, 322, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(dateLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jDateChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(resumeLabel))
                        .addGap(38, 38, 38)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(datetexteLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jComboBox2, 0, 113, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 317, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(imagefilenameLabel)
                        .addGap(59, 59, 59)
                        .addComponent(imagefilenameField, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(parcourirvignette))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lienfichierLabel)
                            .addComponent(lienimageLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(lienimageField)
                            .addComponent(lienfichierField, javax.swing.GroupLayout.DEFAULT_SIZE, 231, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 297, Short.MAX_VALUE))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 481, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(auteurLabel)
                                .addGap(18, 18, 18))
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(sourceLabel)
                                .addComponent(titreLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE)))
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(typedocumentLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(typedocCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(titreField, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(auteurField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 421, Short.MAX_VALUE))
                                .addGap(34, 34, 34)))
                        .addGap(18, 18, 18)
                        .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(imagefilenameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(imagefilenameLabel)
                    .addComponent(parcourirvignette))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(sourceLabel)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(typedocumentLabel)
                    .addComponent(typedocCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(titreLabel)
                    .addComponent(titreField, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(auteurLabel)
                    .addComponent(auteurField, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(dateLabel)
                            .addComponent(datetexteLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(resumeLabel)
                            .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jDateChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lienfichierLabel)
                    .addComponent(lienfichierField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lienimageLabel)
                    .addComponent(lienimageField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton3)))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(11, 11, 11))
        );

        jPanel3.setBackground(new java.awt.Color(0, 0, 0));
        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 153, 0), 3, true), "Validation administrative", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.TOP, new java.awt.Font("Tahoma", 3, 14), new java.awt.Color(255, 204, 0))); // NOI18N

        idcorrecteurLabel.setFont(new java.awt.Font("Times New Roman", 1, 14));
        idcorrecteurLabel.setForeground(new java.awt.Color(255, 255, 255));
        idcorrecteurLabel.setText("Id Correcteur:");

        jButton1.setFont(new java.awt.Font("Times New Roman", 1, 12));
        jButton1.setForeground(new java.awt.Color(153, 0, 0));
        jButton1.setText("validation");

        datecorrectionLabel.setFont(new java.awt.Font("Times New Roman", 1, 14));
        datecorrectionLabel.setForeground(new java.awt.Color(255, 255, 255));
        datecorrectionLabel.setText("Date de Correction:");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(idcorrecteurLabel)
                        .addGap(36, 36, 36))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(datecorrectionLabel)
                        .addGap(18, 18, 18)))
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(idcorrecteurField)
                    .addComponent(datecorrectionField, javax.swing.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE))
                .addGap(36, 36, 36)
                .addComponent(jButton1)
                .addContainerGap(310, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(datecorrectionField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(datecorrectionLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(idcorrecteurLabel)
                    .addComponent(idcorrecteurField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton1))
                .addContainerGap(22, Short.MAX_VALUE))
        );

        jPanel1.setBackground(new java.awt.Color(204, 204, 204));
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(153, 0, 51), 3, true), "historique du document", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Verdana", 3, 14), new java.awt.Color(102, 0, 0))); // NOI18N

        jComboBox3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Fonds propres CEHA (droits réservés)", "Item 2", "Item 3", "Item 4" }));

        dimensionLabel.setBackground(new java.awt.Color(255, 255, 255));
        dimensionLabel.setFont(new java.awt.Font("Verdana", 3, 12));
        dimensionLabel.setText("Dimension:");

        localisationLabel.setBackground(new java.awt.Color(255, 255, 255));
        localisationLabel.setFont(new java.awt.Font("Verdana", 3, 12));
        localisationLabel.setText("Localisation:");

        datedonationLabel.setBackground(new java.awt.Color(255, 255, 255));
        datedonationLabel.setFont(new java.awt.Font("Verdana", 3, 12));
        datedonationLabel.setText("Datedonation:");

        fondLabel.setBackground(new java.awt.Color(255, 255, 255));
        fondLabel.setFont(new java.awt.Font("Verdana", 3, 12));
        fondLabel.setText("Fond:");

        droitsreproLabel.setFont(new java.awt.Font("Verdana", 3, 12));
        droitsreproLabel.setText("Droits de reproduction:");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(fondLabel)
                    .addComponent(datedonationLabel)
                    .addComponent(droitsreproLabel)
                    .addComponent(localisationLabel)
                    .addComponent(dimensionLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jTextField1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 581, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(localisationField, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(dimensionField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE))
                    .addComponent(jComboBox3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(datedonationField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 581, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(fondLabel)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(datedonationLabel)
                    .addComponent(datedonationField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(droitsreproLabel)
                    .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(localisationLabel)
                    .addComponent(localisationField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(dimensionLabel)
                    .addComponent(dimensionField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(34, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(19, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void typedocComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_typedocComboActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_typedocComboActionPerformed

    private void parcourirvignetteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_parcourirvignetteActionPerformed
        //upload des vignettes
        //
        String ressourceStrRef = "C:/Documents and Settings/Gilles/CEHA/CehaFicheLibraryv1.1/src/ceha/resource/vignette/";
        ////
        JFileChooser chooser = new JFileChooser();
        int returnVal = chooser.showOpenDialog(this);
        if (returnVal == JFileChooser.APPROVE_OPTION) {

            File copie = new File(chooser.getSelectedFile().getAbsolutePath());
            File toCopy = new File("C:/Documents and Settings/Gilles/CEHA/CehaFicheLibraryv1.1/src/ceha/resource/vignette/" + chooser.getSelectedFile().getName());
            try {
                Utils.copyFile(copie, toCopy);

            } catch (IOException ex) {
                ex.printStackTrace();
            }
            imagefilenameField.setText(chooser.getSelectedFile().getAbsolutePath());
            vignette.setIcon(new javax.swing.ImageIcon("C:/Documents and Settings/Gilles/CEHA/CehaFicheLibraryv1.1/src/ceha/resource/vignette/" + chooser.getSelectedFile().getName()));
            //          vignette.repaint();
        }
    }//GEN-LAST:event_parcourirvignetteActionPerformed

    private void jButton2lienfichierActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2lienfichierActionPerformed

        JFileChooser chooser = new JFileChooser();
        int returnVal = chooser.showOpenDialog(this);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            imagefilenameField.setText(chooser.getSelectedFile().getAbsolutePath());
        }
}//GEN-LAST:event_jButton2lienfichierActionPerformed

    private void jButton3lienimageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3lienimageActionPerformed
        JFileChooser chooser = new JFileChooser();
        int returnVal = chooser.showOpenDialog(this);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            lienimageField.setText(chooser.getSelectedFile().getAbsolutePath());
        }
}//GEN-LAST:event_jButton3lienimageActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField auteurField;
    private javax.swing.JLabel auteurLabel;
    private javax.swing.JLabel dateLabel;
    private javax.swing.JTextField datecorrectionField;
    private javax.swing.JLabel datecorrectionLabel;
    private javax.swing.JTextField datedonationField;
    private javax.swing.JLabel datedonationLabel;
    private javax.swing.JLabel datetexteLabel;
    private javax.swing.JTextField dimensionField;
    private javax.swing.JLabel dimensionLabel;
    private javax.swing.JLabel droitsreproLabel;
    private javax.persistence.EntityManager entityManager;
    private javax.swing.JLabel fondLabel;
    private javax.swing.JTextField idcorrecteurField;
    private javax.swing.JLabel idcorrecteurLabel;
    private javax.swing.JTextField imagefilenameField;
    private javax.swing.JLabel imagefilenameLabel;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JComboBox jComboBox3;
    private com.toedter.calendar.JDateChooser jDateChooser1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea jTextArea1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField lienfichierField;
    private javax.swing.JLabel lienfichierLabel;
    private javax.swing.JTextField lienimageField;
    private javax.swing.JLabel lienimageLabel;
    private java.util.List<ceha.Fiche> list;
    private javax.swing.JTextField localisationField;
    private javax.swing.JLabel localisationLabel;
    private javax.swing.JButton parcourirvignette;
    private javax.persistence.Query query;
    private javax.swing.JLabel resumeLabel;
    private javax.swing.JLabel sourceLabel;
    private javax.swing.JTextField titreField;
    private javax.swing.JLabel titreLabel;
    private javax.swing.JComboBox typedocCombo;
    private javax.swing.JLabel typedocumentLabel;
    private javax.swing.JLabel vignette;
    // End of variables declaration//GEN-END:variables
}
